import { BaseCommand } from "./BaseCommand";
import { API_EVENT, COMMAND_STATUS } from "@/FrontProcessing/interface";
/**
 * Cmd_Mesh_Remesh
 * @description 网格重新剖分
 */
export class Cmd_Mesh_Remesh extends BaseCommand {
  event = API_EVENT.MESH_REMESH;
  execute(): Promise<boolean> {
    this.system.history.push(this);
    return new Promise((resolve) => {
      this.status = COMMAND_STATUS.RUNNING;
      this.system
        .mesh_remesh({
          ...this.params,
        })
        .then((result) => {
          this.status = COMMAND_STATUS.FINISHED;
          resolve(result);
        });
    });
  }

  undo(): boolean {
    return false;
  }
}
